<?php
//API分组
use app\middleware\MemberAuthCheckMiddleware;
use Webman\Route;

//需要用户权限
Route::group('/api/auth/', function () {
    Route::post('orderLists', [app\controller\OrderController::class, 'orderLists']);//订单列表
    Route::post('orderDetails', [app\controller\OrderController::class, 'orderDetails']);//订单详情
    Route::post('orderApplyRefund', [app\controller\OrderController::class, 'orderApplyRefund']);//申请退款
    Route::post('orderRefundDetails', [app\controller\OrderController::class, 'orderRefundDetails']);//售后详情
    Route::post('orderRefundProgress', [app\controller\OrderController::class, 'orderRefundProgress']);//退款进度
    Route::post('orderToPrePay', [app\controller\OrderController::class, 'orderToPrePay']);//商品预下单
    Route::post('orderToPay', [app\controller\OrderController::class, 'orderToPay']);//商品下单
    Route::post('orderResetPay', [app\controller\OrderController::class, 'orderResetPay']);//重新支付
    Route::post('orderInvoice', [app\controller\OrderController::class, 'orderInvoice']);//申请开票
    Route::post('orderInvoiceHistory', [app\controller\OrderController::class, 'orderInvoiceHistory']);//申请开票上一次记录
    Route::post('orderToComment', [app\controller\OrderController::class, 'orderToComment']);//发表评论
    Route::post('goodsDetails', [app\controller\GoodsController::class, 'details']);//商品详情
    Route::post('goodsConcern', [app\controller\GoodsController::class, 'goodsConcern']);//取消/关注操作
    Route::post('orderRefundRelation', [app\controller\OrderController::class, 'orderRefundRelation']);//售后申请关联信息
    Route::post('camperList', [app\controller\CamperController::class, 'index']);//营员列表
    Route::post('camperDetails', [app\controller\CamperController::class, 'details']);//营员详情
    Route::post('camperAdd', [app\controller\CamperController::class, 'add']);//新增营员
    Route::post('camperEdit', [app\controller\CamperController::class, 'edit']);//编辑营员
    Route::post('camperDel', [app\controller\CamperController::class, 'del']);//删除营员

    Route::post('toSubmitFeedBack', [app\controller\FeedBackController::class, 'toSubmitFeedBack']);//提交意见反馈

    Route::post('withdrawalLists', [app\controller\WithdrawalController::class, 'withdrawalLists']);//提现明细
    Route::post('toApplyWithdrawal', [app\controller\WithdrawalController::class, 'toApplyWithdrawal']);//提现操作
    Route::post('toWithdrawalConfig', [app\controller\WithdrawalController::class, 'toWithdrawalConfig']);//提现配置
    Route::post('toApplyDistribution', [app\controller\DistributionController::class, 'toApplyDistribution']);//申请推荐官
    Route::post('userCommissionLists', [app\controller\DistributionController::class, 'userCommissionLists']);//佣金明细
    Route::post('distributionOrder', [app\controller\DistributionController::class, 'distributionOrder']);//分销订单
    Route::post('userDistributionData', [app\controller\DistributionController::class, 'userDistributionData']);//我的分销数据
    Route::post('myInvitation', [app\controller\DistributionController::class, 'myInvitation']);//我的邀请成员
    Route::post('myPromotionPoster', [app\controller\DistributionController::class, 'myPromotionPoster']);//我的分销海报

    Route::post('checkUserDistributionAuth', [app\controller\DistributionController::class, 'checkUserDistributionAuth']);//检测分销权限

})->middleware([
    MemberAuthCheckMiddleware::class
]);

//不需要用户权限
Route::group('/api/', function () {
    Route::post('miniProgramLogin', [app\controller\MemberController::class, 'miniProgramLogin']);//用户第三方授权登录
    Route::post('quickLogin', [app\controller\MemberController::class, 'quickLogin']);//快捷登录
    Route::post('sendSms', [app\controller\MemberController::class, 'sendSms']);//发送短信
    Route::post('home', [app\controller\IndexController::class, 'index']);//获取首页数据
    Route::post('goodsCateTreeLists', [app\controller\GoodsCateController::class, 'treeLists']);//商品分类列表
    Route::post('goodsLists', [app\controller\GoodsController::class, 'lists']);//商品列表
    Route::post('uploadPic', [app\controller\UploadController::class, 'uploadPic']);//上传图片
    Route::post('userCenter', [app\controller\MemberController::class, 'userCenter']);//个人中心
    Route::post('goodsEventCalendar', [app\controller\GoodsController::class, 'goodsEventCalendar']);//活动日历商品
    Route::post('goodsActivityEvent', [app\controller\GoodsController::class, 'goodsActivityEvent']);//活动日历
    Route::post('kfConfig', [app\controller\IndexController::class, 'kfConfig']);//获取客服配置
    Route::post('unbindRelationship', [app\controller\MemberController::class, 'unbindRelationship']);//解除绑定
});